<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterChatAddCoulumIsAnsterKey extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('chat_group_session', function (Blueprint $table) {
            $table->unsignedTinyInteger('isAnswer')->default(0)->comment('0 否 1 是 是否回答答案')->after('status');
        });
        Schema::table('chat_group_history', function (Blueprint $table) {
            $table->unsignedTinyInteger('isAnswer')->default(0)->comment('0 否 1 是 会话是否存在答案')->after('type');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('chat_group_session', function (Blueprint $table) {
            $table->dropColumn('isAnswer');
        });
        Schema::table('chat_group_history', function (Blueprint $table) {
            $table->dropColumn('isAnswer');
        });
    }
}
